package com.sanq.product.mcgs.entity;

import com.sanq.product.config.utils.string.MatcherUtil;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

public class MemberParam implements Serializable {

    private Integer id;

    @NotBlank
    @Email
    private String email;

    @NotBlank
    private String realName;

    @NotBlank
    @Pattern(regexp = MatcherUtil.TEL_REGEX)
    private String tel;

    @NotNull
    private Integer userType;

    @NotBlank
    private String cover;

    private Integer userStatus;

    public MemberParam() {
    }

    public MemberParam(Integer id, String email, String realName, String tel, Integer userType, String cover, Integer userStatus) {
        this.id = id;
        this.email = email;
        this.realName = realName;
        this.tel = tel;
        this.userType = userType;
        this.cover = cover;
        this.userStatus = userStatus;
    }

    public Integer getUserStatus() {
        return userStatus;
    }

    public void setUserStatus(Integer userStatus) {
        this.userStatus = userStatus;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public static class Build {
        private Integer id;
        private String email;
        private String realName;
        private String tel;
        private Integer userType;
        private String cover;
        private Integer userStatus;

        public Build setId(Integer id) {
            this.id = id;
            return this;
        }

        public Build setEmail(String email) {
            this.email = email;
            return this;
        }

        public Build setRealName(String realName) {
            this.realName = realName;
            return this;
        }

        public Build setTel(String tel) {
            this.tel = tel;
            return this;
        }

        public Build setUserType(Integer userType) {
            this.userType = userType;
            return this;
        }

        public Build setCover(String cover) {
            this.cover = cover;
            return this;
        }

        public Build setUserStatus(Integer userStatus) {
            this.userStatus = userStatus;
            return this;
        }

        public MemberParam builder() {
            return new MemberParam(id, email, realName, tel, userType, cover, userStatus);
        }
    }
}
